new Vue({
    el: '#app',
    data: {
        tableData: [{
            id: 1,
            date: '2016-05-03',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1518 弄',
            zip: 200333
          }, {
            id: 2,
            date: '2016-05-02',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1518 弄',
            zip: 200333
          }, {
            id: 3,
            date: '2016-05-04',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1518 弄',
            zip: 200333
          }, {
            id: 4,
            date: '2016-05-01',
            name: '王小虎',
            province: '上海',
            city: '普陀区',
            address: '上海市普陀区金沙江路 1518 弄',
            zip: 200333
          }],
          formData: {
              id: '',
              address: ''
          },
          dialogFormVisible: false
    },
    methods: {
        delect (scope) {
            this.$tableData = this.tableData.splice(scope.$index,1)
        },
        edit (scope) {
            this.formData.address = scope.row.address;
            this.formData.id = scope.$index;
            this.dialogFormVisible = true;
        },
        submit () {
            this.tableData[this.formData.id].address = this.formData.address;
            this.formData.address = '';
            this.formData.id = '';
            this.dialogFormVisible = false;
        }
    }
})